﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using DTO;
using BUS;
using System.Collections.Generic;

namespace WebSieuThi.TinHoc.QuanLiTaiKhoanAjax
{
    public partial class loaddstk : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            List<TaiKhoanNguoiDung> ls = new List<TaiKhoanNguoiDung>();
            ls = TaiKhoanNguoiDungBUS.LayDS();
            

            string str = "";
            string str1 = "<select id=\"Select2\" name=\"D1\" onchange=\"\">";

            List<LoaiNhanVien> ll = new List<LoaiNhanVien>();
            ll = LoaiNhanVienBUS.LayDS();

            for (int i = 0; i < ll.Count; ++i)
            {
                str1 += "<option value=\"" + ll[i].Id + "\">" + ll[i].TenLoaiNV+ "</option>";
            }

            str += "<table border=\"1\">";
            str += "<tr><td>Username</td><td>Loại nhân viên</td><td>Ngày đăng kí</td><td>Email</td><td>Delete</td>";


            for (int i = 0; i < ls.Count; ++i)
            {
                str += "<tr><td>" + ls[i].UserName + "</td><td>" + ls[i].LoaiNhanVien.TenLoaiNV+ "</td><td>" + ls[i].NgayDangKi+ "</td><td>" + ls[i].Email + "</td><td><input name=\"" + ls[i].Id.ToString() + "\" type=\"button\" value=\"Delete\"  onclick=\"xoaus(this.name)\"/></td>";
                    
            }

            str += "<tr><td><input type=\"text\" name=\"txtusername\" size=\"8\"/></td><td>";
            str += str1 + "</td><td><input type=\"text\" name=\"txtngaydk\" size=\"10\" value=\""+DateTime.Now+"\" /></td><td><input type=\"text\" name=\"txtemail\" size=\"15\"/>";
            str += "</td><td>";
            str += "<input type=\"button\" value=\"Add\"  onclick=\"themus()\"/></td></tr>";

            str += "</table>";

            

            Response.Write(str);
        }
    }
}
